//
//  DataUtils.m
//  TravelWithYourHeart
//
//  Created by 邹功梁 on 15/9/22.
//  Copyright (c) 2015年 邹功梁. All rights reserved.
//

#import "DataUtils.h"

@implementation DataUtils

+ (NSString *)DataUtils:(NSDictionary *)dic
{
    NSString *str = @"";
    NSArray *array = [dic allKeys];
    for (NSString * key in array) {
        if ([[dic objectForKey:key] isKindOfClass:[NSString class]]) {
            str = [str stringByAppendingString:[NSString stringWithFormat:@"@property (nonatomic, copy) NSString* %@;\n", key]];
        }
        else if ([[dic objectForKey:key] isKindOfClass:[NSNumber class]]) {
            str = [str stringByAppendingString:[NSString stringWithFormat:@"@property (nonatomic, retain) NSNumber* %@;\n", key]];
        }
        else if ([[dic objectForKey:key] isKindOfClass:[NSDictionary class]])
        {
            str = [str stringByAppendingString:[NSString stringWithFormat:@"@property (nonatomic, retain) NSDictionary* %@;\n", key]];
        }
        else
        {
            str = [str stringByAppendingString:[NSString stringWithFormat:@"@property (nonatomic, assign) BOOL %@;\n", key]];
        }
    }
    return str;
}

@end
